package com.easepal7506a.project.ui.presenter;


import android.util.Log;

import com.easepal.socketiolib.model.SocketModel;
import com.easepal7506a.project.Constant.CommmandNum;
import com.easepal7506a.project.observer.SocketDataObserver;
import com.easepal7506a.project.ui.iview.IShoulderAdjustView7506;

/**
 * 肩部检测
 * Created by FHB on 2018/4/4.
 */

public class ShoulderAdjustPresenter7506 implements SocketDataObserver.SocketReceive {
    IShoulderAdjustView7506 mView;
    private String mAdjustOk="-1" ;
    public ShoulderAdjustPresenter7506(IShoulderAdjustView7506 view) {
        mView = view;
        SocketDataObserver.getInst().registerObserver(this);
    }


    @Override
    public void onRceiveSocket(SocketModel model) {
        String key  = model.getKey();
        String value = model.getValue();
        if(key.equals(CommmandNum.mStatusShoulderAdjust)){
            Log.e("ShoulderAdjust",value+"");
            if(value.equals("0")){
                mView.isFinish();
            }
        }else  if(key.equals(CommmandNum.mStatusPointPosition)){
                mView.getPoint(Integer.valueOf(value));
          }

    }
    public void onDestoty(){
        SocketDataObserver.getInst().removeObserver(this);
    }
}
